package com.ruoxi.blog.test;

/**
	* @author YaoXian
	* @title: TeamGame
	* @projectName ruoxi-blog
	* @description: 若兮微服务 - 力扣 - 字节跳动竞赛题
	* @date 2021-03-08 20:13
	*/
public class TeamGame {
		
		private static int count = 0;
		
		public static void main(String[] args) {
		//theWinners(14);
		decimalise("2563299");
		}
		
		public static void theWinners(int num){
				while (true){
						if (num < 2){
								break;
						}
						if (num%2 == 0){
								num = num/2;
								count = num + count;
						}else {
								count = (num-1)/2 + count;
								num = (num-1)/2 + 1;
						}
				}
				System.out.println(count);
		}
		
		/**
			* 十 - 二进制最大数问题
			* @param n
			*/
		public static void decimalise(String n){
				
				int max = 0;
				for (int i = 0; i < n.length(); i++) {
						String string = n.substring(i,i+1);
						if (Integer.parseInt(string) > max){
								max = Integer.parseInt(string);
						}
				}
				System.out.println(max);
		}
}
